//
//  MeListBtnCell.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/17.
//

#import "MeListBtnCell.h"

@interface MeListBtnCell()
@property (nonatomic,strong) UIImageView * iconView;
@property (nonatomic,strong) UILabel * infoLabel;
@end

@implementation MeListBtnCell


-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self addSubview:self.iconView];
    [_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@0);
        make.centerX.equalTo(@0);
        make.size.mas_offset(CGSizeMake(50 * FMScaleX, 50 * FMScaleX));
    }];
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.right.equalTo(@0);
    }];
}

-(void)setHeadIndex:(NSInteger)headIndex{
    
    switch (headIndex) {
        case 0:
            self.iconView.image = [UIImage imageNamed:@"Me_list_report"];
            self.infoLabel.text = @"健康报告";
            break;
        case 1:
            self.iconView.image = [UIImage imageNamed:@"Me_list_horder"];
            self.infoLabel.text = @"健康订单";
            break;
        case 2:
            self.iconView.image = [UIImage imageNamed:@"Me_list_record"];
            self.infoLabel.text = @"在线咨询";
            break;
        case 3:
            self.iconView.image = [UIImage imageNamed:@"Me_list_box"];
            self.infoLabel.text = @"福利卡包";
            break;
       
        default:
            break;
    }
    
}

-(void)setIndex:(NSInteger)index{
    
    switch (index) {
    
        case 0:
            self.iconView.image = [UIImage imageNamed:@"Me_list_device"];
            self.infoLabel.text = @"设备管理";
            break;
        case 1:
            self.iconView.image = [UIImage imageNamed:@"Me_list_address"];
            self.infoLabel.text = @"收货地址";
            break;
        case 2:
            self.iconView.image = [UIImage imageNamed:@"Me_list_dorder"];
            self.infoLabel.text = @"兑换记录";
            break;
//        case 1:
//            self.iconView.image = [UIImage imageNamed:@"Me_list_famliy"];
//            self.infoLabel.text = @"家庭管理";
//            break;
    
        case 3:
            self.iconView.image = [UIImage imageNamed:@"Me_list_account"];
            self.infoLabel.text = @"账号安全";
            break;
        case 4:
            self.iconView.image = [UIImage imageNamed:@"Me_list_fb"];
            self.infoLabel.text = @"问题反馈";
            break;
        case 5:
            self.iconView.image = [UIImage imageNamed:@"Me_list_about"];
            self.infoLabel.text = @"关于我们";
            break;
        case 6:
            self.iconView.image = [UIImage imageNamed:@"Me_list_out"];
            self.infoLabel.text = @"退出登陆";
            break;
            
        default:
            break;
    }
    
}

-(UIImageView *)iconView{
    
    if (!_iconView) {
        _iconView = [[UIImageView alloc]init];
        _iconView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _iconView;
}
-(UILabel *)infoLabel{
    
    if (!_infoLabel) {
        _infoLabel = [[UILabel alloc]init];
        _infoLabel.font = Regular(12 * FMScaleX);
        _infoLabel.textColor = RDRGB(0x8C6651);
    }
    return _infoLabel;
}
@end
